package qms



import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Project)
@Mock([Organisation, Unit, Project, Employee])
class ProjectTests {

    void testCreate() {
		def org = new Organisation(name: "Main", description: "description goes here")
		org.save()

		def unit1 = new Unit(name: "Unit", description: "description")
		org.addToUnits(unit1)
		unit1.save()

		def project1 = new Project(name: "Project 1", description: "empty")
		unit1.addToProjects(project1)
		project1.save()

		assert Organisation.count() == 1
		assert Unit.count() == 1
		assert Project.count() == 1
		assert Employee.count() == 0
    }
}
